package com.bj.dljd.models.response;


import lombok.Builder;
import lombok.Data;


@Builder
@Data
public class R {
    public  Integer code;
    public  String msg;
    public  Object data;

    public R(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public R() {
    }

    public R(Integer code) {
        this.code = code;
    }

    public R(String msg) {
        this.msg = msg;
    }

    public R(Object data) {
        this.data = data;
    }

    public static R Ok(){
        return R.builder().code(200).msg("业务成功处理").data(null).build();
    }
    public static R Ok(String data){
       return R.builder().code(200).msg(data).data(null).build();
    }
    public static R Ok(Object object,String data){
        return R.builder().code(200).msg(data).data(object).build();
    }
    public static R Ok(Object object){
        return R.builder().code(200).data(object).msg("业务成功处理").build();
    }
    public static R fuil(Object object,String data){
        return R.builder().code(301).msg(data).data(object).build();
    }

    public static R fuil(String data){
        return R.builder().code(301).msg(data).data(null).build();
    }
    public static R fuil(){
        return R.builder().code(301).msg("业务处理失败").data(null).build();
    }
    public static R fuil(Object object){
        return R.builder().code(301).data(object).msg("业务处理失败").build();
    }
}
